package com.xunshibao.thread;

import java.util.ArrayList;
import java.util.List;

public class SaleTickets {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Saler s = new Saler();
        new Thread(s).start();
        new Thread(s).start();
        new Thread(s).start();
    }

}

class Saler extends Thread {
    private int tickets = 5;

    public void run() {
        while (this.tickets > 0) {
            System.out.println("sale tiket = " + this.tickets--);
            List list  = new ArrayList();
            list.size();
        }
    }
}